import { message, Modal } from 'ant-design-vue';
export const parseCode = (code?: string | number) =>
  code !== undefined && code !== null && code !== ''
    ? isNaN(+code)
      ? code
      : +code
    : code;

export const showModal = (content: string) => {
  Modal.error({
    title: '系统提示',
    content,
    okText: '确定',
    // 这里点击确定将关闭所有弹框
    onOk() {
      Modal.destroyAll();
    }
  });
};

export const showMsg = (content: string) => {
  message.error({
    content
  });
};
